@import controllers.workspace.routes
@import org.silkframework.workspace.activity.ProjectActivity
@import org.silkframework.runtime.plugin.PluginDescription
@import org.silkframework.workspace.activity.TaskActivityFactory
@import scala.language.existentials
@import org.silkframework.runtime.plugin.AnyPlugin

@(activity: ProjectActivity)

@widgets.pluginDialog(
    name = activity.name,
    plugins = PluginDescription(activity.factory.getClass) :: Nil,
    currentObj = Some(activity.factory.asInstanceOf[AnyPlugin]),
    resources = Nil) {

  <script type="text/javascript">
    function savePlugin(pluginId, name, parameters) {
      $.post(
        '@Html(routes.ActivityApi.postActivityConfig(activity.project.name, "", activity.name).url)',
        parameters
      ).done(function() {
        closeDialog();
      }).fail(function(response) {
        alert(response.responseText);
      });
    }
  </script>
}